package cm.iccsoft.android.telecomcost.activities;

import cm.iccsoft.android.telecomcost.R;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends TelecomcostActivity {

	private Button btnZones;
	private Button btnCountries;
	private Button btnProvider;
	private Button btnDailyThreshold;
	private Button btnMonthlyThreshold;
	private Button btnWeeklyTreshold;
	private Button btnZonesThreshold;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		Log.i("MainActivity", "Creating the main Activity");
		super.onCreate(savedInstanceState);		
		setContentView(R.layout.main);

		btnZones = (Button) findViewById(R.id.btnZones);
		if(btnZones != null)
		{
			btnZones.setOnClickListener(new OnClickListener() {

				public void onClick(View arg0) {
					showZones();
				}
			});
		}		
		
		btnCountries = (Button) findViewById(R.id.btnCountries);
		btnCountries.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {				
				showCountries();
			}
		});		
		
		btnProvider = (Button) findViewById(R.id.btnProvider);
		btnProvider.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				showProvider();
			}
		});
		
		btnDailyThreshold = (Button) findViewById(R.id.btnDailyThreshold);
		btnDailyThreshold.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				showDailyThreshold();
			}
		});
		
		btnMonthlyThreshold = (Button) findViewById(R.id.btnMonthlyThreshold);
		btnMonthlyThreshold.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				showMonthlyThreshold();
			}
		});
		
		btnWeeklyTreshold = (Button) findViewById(R.id.btnWeeklyTreshold);
		btnWeeklyTreshold.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {				
				showWeeklyThreshold();
			}
		});
		
		btnZonesThreshold = (Button) findViewById(R.id.btnZonesThreshold);
		btnZonesThreshold.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {				
				showZonesThreshold();
			}
		});
	}

	protected void showZonesThreshold() {
		Intent intent = new Intent().setClass(MainActivity.this,
				ZoneThresholdListActivity.class);
		startActivity(intent);
	}

	protected void showWeeklyThreshold() {
		Intent intent = new Intent().setClass(MainActivity.this,
				WeeklyThresholdListActivity.class);
		startActivity(intent);
	}

	protected void showMonthlyThreshold() {
		Intent intent = new Intent().setClass(MainActivity.this,
				MonthlyThresholdListActivity.class);
		startActivity(intent);
	}

	protected void showDailyThreshold() {		
		Intent intent = new Intent().setClass(MainActivity.this,
				DailyThresholdListActivity.class);
		startActivity(intent);
	}

	protected void showProvider() {
		Intent intent = new Intent().setClass(MainActivity.this,
				ProviderListActivity.class);
		startActivity(intent);
	}

	protected void showCountries() {		
		Intent intent = new Intent().setClass(MainActivity.this,
				CountryListActivity.class);
		startActivity(intent);
	}

	private void showZones() {		
		Intent intent = new Intent().setClass(MainActivity.this,
				ZonesListActivity.class);
		startActivity(intent);
	}
}